﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for EQProposalDB
/// </summary>
/// 
namespace CE.PersonalAccident
{
    public class EQProposalDB
    {
        public EQProposalDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(EQProposal eqproposal)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocPAProposalInsertUpdateSingleItemEQ";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@PAProposalId", eqproposal.PAProposalId);
            _sPara.Add("@PAId", eqproposal.PAId);
            _sPara.Add("@PACompanyId", eqproposal.PACompanyId);
            _sPara.Add("@PAInsId", eqproposal.PAInsId);
            _sPara.Add("@Salutation", eqproposal.Salutation);
            _sPara.Add("@Name", eqproposal.Name);
            _sPara.Add("@PostalCode", eqproposal.PostalCode);
            _sPara.Add("@UnitNo", eqproposal.UnitNo);
            _sPara.Add("@HomeNo", eqproposal.HomeNo);
            _sPara.Add("@Address", eqproposal.Address);
            _sPara.Add("@Gender", eqproposal.Gender);
            _sPara.Add("@NRICNo", eqproposal.NRICNo);
            _sPara.Add("@Nationality", eqproposal.Nationality);
            _sPara.Add("@MobileNo", eqproposal.MobileNo);
            _sPara.Add("@OfficePhoneNo", eqproposal.OfficePhoneNo);
            _sPara.Add("@HomePhoneNo", eqproposal.HomePhoneNo);
            _sPara.Add("@Email", eqproposal.Email);
            _sPara.Add("@NatureofBusiness", eqproposal.NatureofBusiness);
            _sPara.Add("@CompanyROCNo", eqproposal.CompanyROCNo);
            _sPara.Add("@SpouseName", eqproposal.SpouseName);
            _sPara.Add("@SpouseGender", eqproposal.SpouseGender);
            _sPara.Add("@SpouseNRICNo", eqproposal.SpouseNRICNo);
            _sPara.Add("@SpouseNationality", eqproposal.SpouseNationality);
            _sPara.Add("@SpouseRelation", eqproposal.SpouseRelation);
            _sPara.Add("@OccupationDuty", eqproposal.OccupationDuty);
            _sPara.Add("@HasMachinery", eqproposal.HasMachinery);
            _sPara.Add("@Machinery", eqproposal.Machinery);
            _sPara.Add("@HasEngagedSportsActivities", eqproposal.HasEngagedSportsActivities);
            _sPara.Add("@EngagedSportsActivities", eqproposal.EngagedSportsActivities);
            _sPara.Add("@HasPhysicalDefects", eqproposal.HasPhysicalDefects);
            _sPara.Add("@PhysicalDefects", eqproposal.PhysicalDefects);
            _sPara.Add("@HasDeclinedInsurance", eqproposal.HasDeclinedInsurance);
            _sPara.Add("@DeclinedInsurance", eqproposal.DeclinedInsurance);
            _sPara.Add("@HasIncreasePremium", eqproposal.HasIncreasePremium);
            _sPara.Add("@IncreasePremium", eqproposal.IncreasePremium);
            _sPara.Add("@HasOtherInsurance", eqproposal.HasOtherInsurance);         
            _sPara.Add("@OtherInsuranceCompany", eqproposal.OtherInsuranceCompany);
            _sPara.Add("@OtherInsuranceDetails", eqproposal.OtherInsuranceDetails);
            _sPara.Add("@HasAnyClaimsfromInsurer", eqproposal.HasAnyClaimsfromInsurer);
            _sPara.Add("@AnyClaimsfromInsurer", eqproposal.AnyClaimsfromInsurer);
            _sPara.Add("@PamentType", eqproposal.PamentType);
            _sPara.Add("@RefCEUserId", eqproposal.RefCEUserId);
            _sPara.Add("@ViewedDetailId", eqproposal.ViewedDetailId);
            _sPara.Add("@Status", eqproposal.Status);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }
    }
}